<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>{$seo_title}</title>
		<meta name="Keywords" content="{$seo_keywords}">
		<meta name="Description" content="{$seo_description}">
		{include file="book@web_public/head_static" /}
		<link href="__WEB__css/book.css" rel="stylesheet" />
	</head>
	<body>
		{include file="book@web_public/mini_login" /}
		<div class="content chapter_content chapterInfo">
			<div class="chapter_container">
				<h3 class="chapterInfo-title">{$chapter.chapter_name}</h3>
				<div class="chapterInfo-type">
					<p><i class="fa fa-book"></i> {$book.name}</p>
					<p><i class="fa fa-user"></i> {$book.author}</p>
					<p><i class="fa fa-file-word-o"></i> {$chapter.words}</p>
				</div>
				<div class="chapter-text">
             		{// 判断章节是否收费 }
					{if $chapter.charge}
						{// <h2>章节收费</h2> }
						{if $is_member_login}
							{// <h2>会员已登录</h2> }
							{if $is_chapter_buy}
								{// <h2>会员已购买</h2> }
								{$chapter.content}
							{else}
								{// <h2>会员未购买章节 - 显示购买操作</h2> }
								<div class="ci-option mtb20">
									<h3>这是VIP章节　需要订阅后才能阅读</h3>
									<div>
										<a href="javascript:;" class="chapterBuy" onclick="subscription({$book.id},{$chapter.id})">订阅本章<span>{$chapter.price} {$Think.config.mn_book.read_money_name}</span></a>
										<a href="{:url('book/member.Pay/topup')}" class="chapterBuy" target="_blank" style="margin-left: 5px;">充值<span>余额：{$member.read_money}</span></a>
									</div>
									<div class="cio-msg">您的账户余额为 <span>{$member.read_money}</span> {$Think.config.mn_book.read_money_name}</div>
									<div class="cio-autoOrder clearfix"><label><input type="checkbox" onchange="autoSubscription({$book.id}, this.checked)" class="pull-left" {if $is_auto_subscription && !$fc_auto_subscription}checked{/if}> 自动订阅本书</label></div>
								</div>
							{/if}
						{else}
							{// <h2>会员未登录</h2> }
							<div class="ci-login mtb20">需要登录后才能阅读哦，<a href="javascript:;" class="public-ajax-login">点击登录</a> 或 <a href="{:url('member/register/index')}">注册</a></div>
						{/if}
					{else}
						{// <h2>章节免费</h2> }
						{$chapter.content}
					{/if}
				</div>
				<div class="chapter-pagenavi">
					<a href="{$chapter.prev_page.url|default="javascript:;"}">上一页</a>
					<a href="{:url('book/book/chapterlist',['bid'=>$book.id])}">目录</a>
					<a href="{$chapter.next_page.url|default="javascript:;"}">下一页</a>
				</div>
				<div class="chapterInfo-quick-link">
					<p><a href="{$book.url}"><i class="fa fa-file-text-o"></i><span>书页</span></a></p>
					<p><a href="{:url('book/book/chapterlist',['bid'=>$book.id])}"><i class="fa fa-list"></i><span>目录</span></a></p>
					<p><a href="{$chapter.prev_page.url|default="javascript:;"}"><i class="fa fa-chevron-left"></i><span>上一页</span></a></p>
					<p><a href="{$chapter.next_page.url|default="javascript:;"}"><i class="fa fa-chevron-right"></i><span>下一页</span></a></p>
				</div>
			</div>
		</div>
		{include file="book@web_public/foot" /}
		<script>
			$('.chapterInfo-quick-link').pin({
				containerSelector: '.chapter_container'
			});
			{// <h2>自动订阅扣款失败，取消本书自动订阅功能，并提示</h2> }
			$(function(){
				{if $fc_auto_subscription}
				layer.msg('您的账户余额不足，已关闭本书自动订阅功能！',{icon: 2,time: 3000});
				{/if}
				{if $chapter.charge && !$is_member_login}
					$('#ajax-login-box').show();
				{/if}
			});
		</script>
	</body>
</html>